﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Management.Automation;
using System.Reflection;
using System.Text;
using RabbitMQ.Client;

namespace PoshRabbit
{
    [Cmdlet( VerbsCommon.Get, "RabbitProtocol")]
    public class GetProtocolsCmdlet : Cmdlet
    {
        protected override void BeginProcessing()
        {
            var names = from prop in typeof (Protocols).GetProperties(BindingFlags.Static | BindingFlags.Public)
            where prop.PropertyType == typeof (IProtocol)
            select prop.Name;

            WriteObject( names.ToArray(), true);
        }
    }
}
